class Calculator{
  def calculate(x:Int,y:Int,s:Char):Any=s match{
    case '+'=>x+y
    case '-'=>x-y
    case '*'=>x*y
    case '/'=>x/y
    case _=>"Invalid operator"
  }
}
object Test{
  def main(args:Array[String]){
    val calculator=new Calculator()
    println(calculator.calculate(6,2,'+'))
    println(calculator.calculate(6,2,'-'))
    println(calculator.calculate(6,2,'*'))
    println(calculator.calculate(6,2,'/'))
    println(calculator.calculate(6,2,'^'))
  }
}
